﻿using System;
using System.Collections.Generic;
using System.Linq;
using QL_LichCT.Entities;
using System.Data;

namespace QL_LichCT.DataLayer
{
    class View_CoLichHopDAL
    {
        public static List<View_CoLichHop> GetListByCB(string maCB)
        {
            DataAccessHelper db = new DataAccessHelper();

            string sql = string.Format("select * from View_CoLichHop where macb = '{0}'", maCB);
            DataTable dt = db.GetDataTable(sql);

            List<View_CoLichHop> list = new List<View_CoLichHop>();

            foreach (DataRow row in dt.Rows)
                list.Add(new View_CoLichHop(row));
            return list;
        }
    }
}
